<%- model_class = Campaign -%>
<div class="page-header">
  <h1><%=t '.title', :default => model_class.model_name.human.pluralize.titleize %></h1>
</div>
<table class="table table-striped">
  <thead>
    <tr>
      <th><%= model_class.human_attribute_name(:id) %></th>
      <th><%= model_class.human_attribute_name(:template_id) %></th>
      <th><%= model_class.human_attribute_name(:name) %></th>
      <th><%= model_class.human_attribute_name(:description) %></th>
      <th><%= model_class.human_attribute_name(:active) %></th>
      <th><%= model_class.human_attribute_name(:scope) %></th>
      <th><%= model_class.human_attribute_name(:emails) %></th>
      <th><%= model_class.human_attribute_name(:email_sent) %></th>
      <th><%= model_class.human_attribute_name(:test_email) %></th>
      <th><%= model_class.human_attribute_name(:created_at) %></th>
      <th><%=t '.actions', :default => t("helpers.actions") %></th>
    </tr>
  </thead>
  <tbody>
    <% @campaigns.each do |campaign| %>
      <tr>
        <td><%= link_to campaign.id, campaign_path(campaign) %></td>
        <td><%= campaign.template_id %></td>
        <td><%= campaign.name %></td>
        <td><%= campaign.description %></td>
        <td><%= campaign.active %></td>
        <td><%= campaign.scope %></td>
        <td><%= campaign.emails %></td>
        <td><%= campaign.email_sent %></td>
        <td><%= campaign.test_email %></td>
        <td><%=l campaign.created_at %></td>
        <td>
          <%= link_to t('.edit', :default => t("helpers.links.edit")),
                      edit_campaign_path(campaign), :class => 'btn btn-mini' %>
          <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
                      campaign_path(campaign),
                      :method => :delete,
                      :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
                      :class => 'btn btn-mini btn-danger' %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= link_to t('.new', :default => t("helpers.links.new")),
            new_campaign_path,
            :class => 'btn btn-primary' %>
